  
           <h1>Nouvelle machine</h1>
   
   
    <% form_for(@machine) do |f| %>
     <%#= f.error_messages %>
     <%if flash[:error]%>
             <%= flash[:error] %>
       <% end %>
      <%if flash[:notice]%>
          <%= flash[:notice] %>
       <% end %>
     <p>
       <!-- <%= f.label :id %><br /> -->
        <%= f.hidden_field :id %>

      </p>
    <table width="595" border="0" cellpadding="0" cellspacing="0">

      <tr>
        <td width="166" height="28"> <%= f.label :"Nom de machine" %>&nbsp;</td>
        <td width="429"><%= f.text_field :nommachine %> 
       
        </td>

      </tr>
      <tr>
        <td height="28"> <%= f.label :"Adresse IP" %>&nbsp;</td> <!--:onchange => "verifIp()"-->
        <td><%= f.text_field :ipmachine,:maxlength=>"15"  %>&nbsp;
        </td>

      </tr>
      <tr>
        <td height="28"><%= f.label :"Adresse mac" %>&nbsp;</td>
        <td><%= f.text_field :addmac %>&nbsp; </td>

      </tr>
      <tr>
        <td height="28"><%= f.label :"Système d'exploitation" %>&nbsp;</td>
        <td> <%= f.text_field :os  %>&nbsp;</td>

      </tr>
      <tr>
        <td height="28"> <%= f.label :'Memoire physique' %>&nbsp;</td>
        <td><%= f.text_field :memoiretotale, :maxlength=>"10" %>&nbsp;
        </td>

      </tr>
      <tr>
        <td height="28"><%= f.label :'Disque dur' %>&nbsp;</td>
        <td><%= f.text_field :espacedisquet,:maxlength=>"10" %>&nbsp;
        </td>

      </tr>
    <% if (!params[:salleid].nil?  ) %>
       <%=f.hidden_field :salleid, :value=>params[:salleid], :maxlength=>'15', :style=>'width:25px;',
                       :disabled=>false %>
     <% else   %>
      <tr>
        <td height="28"> <%= f.label :Salle %>&nbsp;</td>
        <td>
          <!--params[:salleid]!=""  || --params[:salleid]!="" (params[:salleid]=="" || params[:salleid].NIL) -->
         <%= collection_select :machine,"salleid", Salle.find(:all),:id, :nomsalle %>&nbsp;<span>&nbsp;&nbsp;&nbsp;</span>
        </td>
      </tr>
     <% end  %>
      <tr>
        <td height="28">&nbsp;</td>
        <td> <%= f.submit 'Ajouter' %>&nbsp;<span  id="machineBack"><%= link_to 'Liste', machines_path %></span></td>

      </tr>
    </table>
    <% end %>

    